local sk__shiqiao = fk.CreateSkill {

  name = "sk__shiqiao",

  tags = {  },

}



sk__shiqiao:addEffect(fk.TurnEnd, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(sk__shiqiao.name) and #player.room.discard_pile > 0 then
      local n = #player.room.logic:getEventsOfScope(GameEvent.UseCard, 999, function(e)
        local use = e.data
        return use and use.from == target and use.card.trueName == "slash"
      end, Player.HistoryTurn)
      if n > 0 then
        event:setCostData(self, n)
        return true
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local randomCards = table.random(room.discard_pile, event:getCostData(self))
    room:moveCardTo(randomCards, Card.PlayerHand, player, fk.ReasonJustMove, sk__shiqiao.name, nil, true, player)
  end,
})

return sk__shiqiao